const x = (() => {}) as Foo;

interface Foo {}
const x = {
  foo: () => {},
} as Foo;

interface Foo {}
const x: Foo = {
  foo: () => {},
};

declare function foo(arg: () => void): void;
foo(() => 1);
foo(() => {});
foo(() => null);
foo(() => true);
foo(() => '');

class Accumulator {
  private count: number = 0;

  public accumulate(fn: () => number): void {
    this.count += fn();
  }
}
new Accumulator().accumulate(() => 1);

(() => true)();

declare function foo(arg: { meth: () => number }): void;
foo({
  meth() {
    return 1;
  },
});
foo({
  meth: function () {
    return 1;
  },
});
foo({
  meth: () => {
    return 1;
  },
});
